package com.zrf.testchatgpt.shiro.manager;


import org.apache.shiro.cache.Cache;
import org.apache.shiro.cache.CacheException;
import org.apache.shiro.cache.CacheManager;

import org.apache.shiro.cache.Cache;
import org.apache.shiro.cache.CacheException;
import org.apache.shiro.cache.CacheManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class RedisCacheManager implements CacheManager {
    @Autowired
    private RedisCache<Object, Object> redisCache;

    @Override
    public <K, V> Cache<K, V> getCache(String s) throws CacheException {
        redisCache.setCacheName(s);
        return (Cache<K, V>) redisCache;
    }
}

